import request from '@/config/axios'

export interface RentBillPayOrderVO {
  id: number
  ownMemberUserId: number
  ownMemberMatCode: string
  memberUserId: number
  orderId: string
  merchantId: string
  terminalId: string
  instMid: string
  subAppid: string
  subOpenid: string
  tradeType: string
  commId: number
  houseId: number
  roomId: number
  startTime: Date
  endTime: Date
  subject: string
  body: string
  roomRentAmount: number
  waterAmount: number
  amount: number
  platformFeeRate: number
  platformFeeAmount: number
  channelFeeRate: number
  channelFeeAmount: number
  balance: number
  status: number
  userIp: string
  expireTime: Date
  successTime: Date
  closeTime: Date
  notifyTime: Date
  refundStatus: number
  refundTime: Date
  refundChannelAmount: number
  refundAmount: number
  fromManageUserId: number
}

// 查询订单列表
export const getRentBillPayOrderPage = async (params) => {
  return await request.get({ url: `/zwsj/rent-bill-pay-order/page`, params })
}

// 查询订单详情
export const getRentBillPayOrder = async (id: number) => {
  return await request.get({ url: `/zwsj/rent-bill-pay-order/get?id=` + id })
}

// 删除订单
export const deleteRentBillPayOrder = async (id: number) => {
  return await request.delete({ url: `/zwsj/rent-bill-pay-order/delete?id=` + id })
}

// 导出订单 Excel
export const exportRentBillPayOrder = async (params) => {
  return await request.download({ url: `/zwsj/rent-bill-pay-order/export-excel`, params })
}

// 获取银联支付结果
export const getUnionMiniPayOrderInfo = async (netPayOrderId: number) => {
  return await request.get({
    url: `/zwsj/rent-bill-pay-order/union/pay/order/info?netPayOrderId=` + netPayOrderId
  })
}
